﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Login.ascx.cs" Inherits="RzCorportativo.Views.Login" %>
<div class="controls">
    <div class="row-fluid">
        <asp:HiddenField runat="server" ID="LoginId" />
        <%--<asp:HiddenField runat="server" ID="GrupoId" />--%>
        <%--<span>E-mail</span>--%>
        <asp:TextBox runat="server" ID="Email" placeholder="E-mail" data-toggle="tooltip"
            title="E-mail" data-placement="left" />
<%--        <asp:TextBox runat="server" ID="Grupo" placeholder="Grupo" type="text" name="complete"
            value="" auto-complete="true" eid="grupo" requesttype="post" contenttype="application/json; charset=utf-8"
            isasync="true" length="1" datatype="json" templeted="true" onrender="getItemGrupo"
            onerror="getErrorGrupo" onselected="selectedItemGrupo" data-toggle="tooltip" title="Grupo"
            data-placement="left" />--%>
    </div>
    <div class="row-fluid">
        <%--<span>Senha</span>--%>
        <asp:TextBox runat="server" ID="Senha" TextMode="Password" placeholder="Senha" data-toggle="tooltip"
            title="Senha" data-placement="left" />
        <%--<span>Confirmar Senha</span>--%>
        <asp:TextBox runat="server" ID="ConfirmarSenha" TextMode="Password" placeholder="Confirmar senha"
            data-toggle="tooltip" title="Confirmar Senha" data-placement="left" />
    </div>
</div>
<script type="text/javascript">
    function getItemGrupo(ul, item) {
        if (item) {
            item.value = item.Descricao;
            item.label = item.Descricao;
        }
        var inner_html = '<a><div class="list_item_container"><div class=""><strong>Grupo:</strong> ' +
                            item.Descricao + '</div></div></a>';
        return $("<li style='width:350px'></li>")
            .data("item.autocomplete", item)
            .append(inner_html)
            .appendTo(ul);
    }

    function getErrorGrupo(e) {
        var _alert = new Alert();
        _alert.Name = "erroGeral";
        _alert.Type = AlertType.Error;
        _alert.AddMessage(e.d ? e.d : e.responseText);
        _alert.Show();
    }
    function selectedItemGrupo(event, ui, context) {
        var item = ui.item && ui.item.value ? ui.item : context;

        if (item.GrupoId) {
            $("input[id$='GrupoId']").val(item.GrupoId.toString(10))
        }
    }
</script>